package cn.hhchat.kit.office;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * Created this one by HMH on 2017/7/16.
 */

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ExcelMatrix {

    List<String> header;

    LinkedList<List<String>> body;

    public String get(Integer x, Integer y) {
        if (x < 0 || x >= body.size()) {
            throw new ArrayIndexOutOfBoundsException("数组越界");
        }
        List<String> row = body.get(x);
        if(y<0||y>=row.size()){
            throw new ArrayIndexOutOfBoundsException("数组越界");
        }
        return row.get(y);
    }

}
